﻿<?php echo $html->css('checkout');?>
<h1><?php $this->pageTitle = __('Thanh toán Ngân Lượng', true); ?></h1>
<div id="content_paypal">
	<div class="body clearfix" id="miniCartContent" style="height: 510px;">
				<?php if(isset($step))
					if ($step==1) {
						?>
		<div id="miniCart">
						<h3>Thông tin đơn hàng</h3>
						<?php if(isset ($set_order_by_id)){
					?>
					<div id="format">
					<table>
						<tr>
						<td><b>Địa chỉ thanh toán</b></td>
						<td>&nbsp;</td>
						<td></td>
						</tr><br>
					
					
						<tr>
						<td>Họ tên:</td>
						<td>&nbsp;</td>
						<td><?php echo $set_order_by_id['Order']['name'];?></td>
						</tr><br>
						<tr>
						<td>Địa chỉ:</td>
						<td>&nbsp;</td>
						<td><?php echo $set_order_by_id['Order']['address'];?></td>
						</tr><br>
						<tr>
						<td>Email:</td>
						<td>&nbsp;</td>
						<td><?php echo $set_order_by_id['Order']['email'];?></td>
						</tr><br>
						<tr>
						<td>Phone:</td>
						<td>&nbsp;</td>
						<td><?php echo $set_order_by_id['Order']['phone'];?></td>
						</tr><br>
						<?php $ship = $this->requestAction("/shipping_methods/view/{$set_order_by_id['Order']['shipping_method_id']}");
							
							$fee_ship= $ship['ShippingMethod']['price'];
							//var_dump($fee_ship);
							//die();
						?>
						
					</table>
					<?php }
					?>
					</div>
					<div class="small head wrap">Mô tả<span class="amount">Số lượng</span></div>
						<ol class="small wrap items limit">
									<li class="seller1">
														<ul>
														   <li class="itmdet" id="multiitem1">
														   <!--doc session-->
															<?php  
																$total = 0;
																if(isset($inf_order)){
																	foreach($inf_order as $item):
																		$product = $this->requestAction("/products/show/{$item['id']}");
																		if(($product['Product']['special_price'])>0){
																		$total = $total + $item['quantity']*$product['Product']['special_price'];
																		}
																		else{
																		$total = $total + $item['quantity']*$product['Product']['price'];
																		}
																		if($item['quantity'] > 0){
																	?>
																	<ul class="item1">
																  <!--kiem tra gia dac biet-->
																  <?php 
																  $special_price=0;
																  if(($product['Product']['special_price'])>0){
																	 $special_price = $product['Product']['special_price'];}
																	 else {
																	 $special_price =  $product['Product']['price'];}
																?>
																  
																  
																	 <li class="dark"><b><span class="accessAid"><?php echo $product['Product']['name']?></span> 
																	 <span class="amount"><?php echo $price->currency($special_price*$item['quantity']);?> </span></b></li>
																	 <li class="secondary">Mã sản phẩm: <?php echo $product['Product']['code']?></li>
																	 <li class="secondary">Giá:<?php echo $price->currency($special_price);?></li>
																	 <li class="secondary">Số lượng:<?php echo $item['quantity'] ?></li>
																  </ul>
															<?php
															}													
															endforeach;
															}?>
															  
															  
														   </li>
														</ul>
														
								 </li>
						</ol>
						
						<div class="wrap items totals item1">
							 <ul>
								<li class="small heavy"><b>Tổng hàng</b> <span class="amount"><b><?php echo $price->currency($total);?></b></span></li>
							 
								
							 </ul>
						 </div>
						 <div class="wrap items totals item1">
							  <ul>
								<li class="small heavy"><b>Phí vận chuyển</b> <span class="amount"><b><?php echo $price->currency($fee_ship);?></b></span></li>
							 
								
							 </ul>
						</div>
						
						
						 <div class="small wrap items totals item1">
							<ul>
													  
							 <li class="heavy highlight finalTotal"><span class="grandTotal amount highlight"><b>Tổng:  <?php echo $price->currency($total+$fee_ship);?> </b></span></li>
							</ul>
											 
						
							
							
							<!--form method="post" action="https://www.nganluong.vn/advance_payment.php"-->
							<!--fieldset-->
							
							<!--input type=hidden name=receiver value="duongthitham.88@gmail.com" /-->
							<!--<input type=hidden name=product value="<?php //echo $set_order_by_id['Order']['id'];?>" /-->
							<!--<input type=hidden name=price value="<?php// echo $price->currency($total+$fee_ship);?>" />
							<input type=hidden name=return_url value="http://www.khieuvudanang.com/fashion/orders/payment_nganluong" />
							<input type=hidden name=comments value="thich gi thi ghi vao day" /-->
							<!--input type=image style="margin-top:25px;" src="https://www.nganluong.vn/data/images/merchant/button/btn-paynow-125.png"  title="Ng&acirc;nL&#432;&#7907;ng.vn: H&#7895; tr&#7907; thanh to&aacute;n tr&#7921;c tuy&#7871;n AN TO&Agrave;N b&#7857;ng th&#7867; c&aacute;c ng&acirc;n h&agrave;ng trong &amp; ngo&agrave;i n&#432;&#7899;c; &#272;&#432;&#7907;c b&#7843;o h&#7897; &amp; c&#7845;p ph&eacute;p b&#7903;i NG&Acirc;N H&Agrave;NG NH&Agrave; N&#431;&#7898;C VI&#7878;T NAM; V&iacute; &#273;i&#7879;n t&#7917; DUY NH&#7844;T &#273;&#432;&#7907;c c&#7897;ng &#273;&#7891;ng b&igrave;nh ch&#7885;n &#431;A TH&Iacute;CH NH&#7844;T 2 n&#259;m li&ecirc;n ti&#7871;p."
						/><br/><a href="http://help.nganluong.vn/khieuvudanang.com.html" target="_blank">[ Hướng dẫn thanh toán ]</a-->
							
							<!--/fieldset-->
							<!--/form--> 
							<a href="<?php echo $urls; ?>"> <img border="0" src="https://www.nganluong.vn/data/images/buttons/11.gif" /> </a>
							<br/><a href="http://help.nganluong.vn/khieuvudanang.com.html" target="_blank">[ Hướng dẫn thanh toán ]</a>
											 
						</div>							
											
											
											
									
														
										
		</div>		
						<?php } elseif ($step ==2){ ?>
								<table>
											<tr>
											<b>Cảm ơn quý khách! </b></tr> <br>
											<tr>Quá trình thanh toán đã được hoàn tất. Chúng tôi sẽ kiểm tra và chuyển hàng sớm!</tr>
											<br><br>
										
									</table>
		
				
						<?php } else { ?>
								<table>
											<tr>
											<b>Cảm ơn quý khách! </b></tr> <br>
											<tr>Quá trình thanh toán không thành công bạn vui lòng thực hiện lại</tr>
											<br><br>
										
									</table>
				
						
				
						<?php	}?>
						
		
	</div>
</div>